package org.springframework.context.event;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;

/**
 * @Name ApplicationEventMulticaster
 * @Description: 注册事件监听器和发布事件的接口
 * @Version v1.0.0
 * @Author: lichao
 * @Date: 2024-03-21 15:43:14
 **/
public interface ApplicationEventMulticaster {

    /**
     * 注册事件监听器
     *
     * @param listener 事件监听器
     * @version v1.0.0
     * @author lichao
     * @date 2024-03-21 15:45:04
     */
    void addApplicationListener(ApplicationListener<?> listener);

    /**
     * 移除事件监听器
     *
     * @param listener 事件监听器
     * @version v1.0.0
     * @author lichao
     * @date 2024-03-21 15:45:28
     */
    void removeApplicationListener(ApplicationListener<?> listener);

    /**
     * 发布事件
     *
     * @param event 事件
     * @version v1.0.0
     * @author lichao
     * @date 2024-03-21 15:45:35
     */
    void multicastEvent(ApplicationEvent event);

}
